package net.tng.strutsEjb.business.service.user;

import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Stateless;

import net.tng.strutsEjb.core.model.user.User;
import net.tng.strutsEjb.core.service.IUserService;
import net.tng.strutsEjb.dao.user.IUserDao;

@Stateless(name = IUserService.EJB_NAME)
public class UserService implements IUserService {

    @EJB
    private IUserDao userDao;

    public User getUserById(String id) {
        return userDao.read(id);
    }

    public List<User> searchUser(String id, String nom, String prenom) {
        return null;
    }

    public void addUser(User user) {
        userDao.create(user);
    }

    public void deleteUser(User user) {
        this.userDao.delete(user);
    }

    public List<User> getAllUsers() {
        return this.userDao.list();
    }

}
